//
//  ViewController.m
//  TestALert
//
//  Created by tao song on 17/7/29.
//  Copyright © 2017年 tao song. All rights reserved.
//

#import "ViewController.h"
#import "HostAlertView.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];



    UIButton  *btn3 = [[UIButton alloc] initWithFrame:CGRectMake(100, 400, 200, 100)];
    
    
    [btn3 addTarget:self action:@selector(show3) forControlEvents:UIControlEventTouchUpInside];
    
    [btn3 setTitle:@"HelloWOrld" forState:UIControlStateNormal];
    [btn3  setBackgroundColor:[UIColor redColor]];
    [self.view addSubview:btn3];

}



- (void)show3
{

   HostAlertView  *hostAlert =  [[HostAlertView alloc] initWithTitle:@"提示" message:@"设置服务器IP及端口" sureBtn:@"确认" cancleBtn:@"取消"];

    hostAlert.alertCallBack = ^(NSArray *data){
    
        NSLog(@"============%@",data);
    };
    
    hostAlert.apiCode = ^(NSInteger apiCode){
        
        NSLog(@"============%ld",apiCode);
    };
    
    [hostAlert showXLAlertView];


}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
